gtkfilechooserwidget: Temporarily disable revealer transitions...
authorTimm Bäder <mail@baedert.org>
Fri, 19 Jul 2019 07:36:25 +0000 (09:36 +0200)
committerTimm Bäder <mail@baedert.org>
Fri, 19 Jul 2019 16:14:49 +0000 (18:14 +0200)
... when going between recent and browse. It just looks weird to have
this transition while the treeview model is just cleared/repopulated
without any transition.

gtk/gtkfilechooserwidget.c

index c419e16d9c2b9c65060fa183f2cd4b65f75eb1ea..0a37e2834d084bd7d3b4d015f358c5d56fcc24ba 100644 (file)
@@ -3051,12 +3051,20 @@ static void
 operation_mode_set_browse (GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
+  GtkRevealerTransitionType old_revealer_transition_type;
 
   gtk_places_sidebar_set_location (GTK_PLACES_SIDEBAR (priv->places_sidebar), priv->current_folder);
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
   location_mode_set (impl, LOCATION_MODE_PATH_BAR);
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "pathbar");
+
+  old_revealer_transition_type = gtk_revealer_get_transition_type (GTK_REVEALER (priv->browse_header_revealer));
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    GTK_REVEALER_TRANSITION_TYPE_NONE);
   gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), TRUE);
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    old_revealer_transition_type);
+
   gtk_widget_set_sensitive (priv->filter_combo, TRUE);
   g_object_notify (G_OBJECT (impl), "subtitle");
 }
@@ -3090,10 +3098,19 @@ operation_mode_set_recent (GtkFileChooserWidget *impl)
 {
   GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
   GFile *file;
+  GtkRevealerTransitionType old_revealer_transition_type;
 
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_files_stack), "list");
   gtk_stack_set_visible_child_name (GTK_STACK (priv->browse_header_stack), "pathbar");
+
+  /* Hide browse_header without a transition */
+  old_revealer_transition_type = gtk_revealer_get_transition_type (GTK_REVEALER (priv->browse_header_revealer));
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    GTK_REVEALER_TRANSITION_TYPE_NONE);
   gtk_revealer_set_reveal_child (GTK_REVEALER (priv->browse_header_revealer), FALSE);
+  gtk_revealer_set_transition_type (GTK_REVEALER (priv->browse_header_revealer),
+                                    old_revealer_transition_type);
+
   location_bar_update (impl);
   recent_start_loading (impl);
   file = g_file_new_for_uri ("recent:///");